<template>
  <div>
    <FilterTable
      ref="table"
      columnsRef="fyhRepairStuff"
      :fetchapi="fetchApi"
      :params="fetchParams"
      :isSelectColumn="false"
      :columns="columns"
      :datakey="'rows'"
      :height="'auto'"
      :onColumnsChange="columns => (this.columns = columns)"
    >
      <template slot="controls">
        <!-- <el-button type="primary" @click="openReception">前台领料</el-button> -->
      </template>
    </FilterTable>
  </div>
</template>

<script>
import { dictionary } from '@/utils/dictMixin';
import { all } from 'q';
import { queryUnitCode } from '@/api/part/partInfo';
import { getChexSelectTable } from '@/api/repair/repairReception/customer/brand.js';
import { queryRepairLabour, querySellMaterial, queryChargeDifferentiationList } from '@/api/repair/repairReception/repairBusinessManger';
import { getSeries } from '@/api/customerRepair/customerCare/insuranceDueRemind/index';
import { getEvaluationList } from '@/api/repair/repairReception/evaluation/index';
// import { getSystemDefault } from '@/api/repair/repairReception/customer';
// import Reception from '@/pages/part/partOutbound/repairMaterials/components/reception';
import { getAllUser } from '@/api/customerRepair/activityVisit/resultEntry'; // 查询所有用户
// import { queryTax } from '@/api/part/partOutbound/repairMaterials/index.js';
import moment from 'moment';
export default {
  name: 'RepairProsssA',
  components: {
    // Reception
  },
  mixins: [dictionary],
  props: ['dataList', 'ESTIMATE_NO'],
  data() {
    return {
      columns: this.createTableColumns(),
      list: [],
      fetchApi: getEvaluationList,
      fetchParams: {}
    };
  },
  created() {
    let roNo = this.ESTIMATE_NO;
    this.fetchParams = Object.assign({}, { code: roNo }, { xhrAbort: false });
    // this.getAllUser();
  },
  mounted() {},
  methods: {
    createTableColumns() {
      let that = this;
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 50,
          render: props => {
            return <span>{props.$index + 1}</span>;
          }
        },
        {
          title: '工具代码',
          dataIndex: 'TOOL_CODE',
          minWidth: 100,
          sorter: true,
          showOverflowTooltip: true
        },
        {
          title: '工具名称',
          dataIndex: 'TOOL_NAME',
          minWidth: 100,
          sorter: true,
          showOverflowTooltip: true
        },
        {
          title: '需求数量',
          dataIndex: 'NEED_COUNT',
          sorter: true,
          // filter: true,
          // filterType: 'input',
          editable: true,
          editType: 'input'
        },
        {
          title: '可用库存',
          dataIndex: 'AVAILABLE_STOCK',
          minWidth: 100,
          sorter: true,
          showOverflowTooltip: true
        },
        {
          title: '缺件标识',
          dataIndex: 'INSPECT_FEE',
          minWidth: 100,
          editable: true,
          defaultEditable: true,
          disabled: true,
          editType: 'checkbox',
          editItems: [
            { text: '', trueValue: 10041001 },
            { text: '', falseValue: 10041002 }
          ]
        }
      ];
    },

    createBaseTable() {
      this.BaseTable = this.$refs.table.$refs.pageTable;
    }
  }
};
</script>

<style lang="less"></style>
